import 'package:flutter/material.dart';
import 'package:flutter_base/app_root_page.dart';
import 'package:flutter_base/http/dio_instance.dart';
import 'package:flutter_base/net/http_helper.dart';
///
/// 1.根页面
/// 2.报错页面
void main() {
  //初始化一些基础配置
  DioInstance.getInstance().initDio(baseUrl: HttpHelper.BASE_URL);
  //启动根目录
  runApp(const AppRootPage());
  //自定义报错页面
  ErrorWidget.builder = (FlutterErrorDetails details) {
    //debug模式下输出日志
    debugPrint(details.toString());
    return Scaffold(
      body: SizedBox(
        width: double.infinity,
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            Text("App错误，快去返回给作者!${details.exception}",
              maxLines: 4,),
          ],
        ),
      ),
    );
  };
}



